package cn.com.assistant.controller;

import cn.com.assistant.entity.QueryEntity;
import cn.com.assistant.service.AssistantService;
import cn.com.assistant.utils.ResponseMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/assistant")
public class AssistantController {

    @Autowired
    private AssistantService assistantService;

    @PostMapping(value = "/query")
    public Map<String, Object> query(@RequestBody QueryEntity queryEntity) {
       return assistantService.query(queryEntity);
    }

    @GetMapping(value = "/getToken")
    public String getToken() throws Exception {
        return assistantService.getToken();
    }

    @GetMapping(value = "/test")
    public ResponseMessage test() throws Exception {
        return assistantService.test();
    }


}
